package com.socket;


import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

//服务端
public class Server_Socket {
    private ServerSocket serverSocket;


    public Server_Socket() {
        try {
            System.out.println("服务器启动...");
            serverSocket = new ServerSocket(8088);
            System.out.println("服务器启动成功...");
        } catch (Exception e) {
            //throw new RuntimeException(e);
            e.printStackTrace();
        }
    }


    public void start() {
        try {
            Socket accept = serverSocket.accept();
        } catch (IOException e) {
            //throw new RuntimeException(e);
            e.printStackTrace();
        }
    }

    public static void main(String[] args) {
        new Server_Socket().start();
    }
}
